package com.link.gateway.core.utils;

import com.link.gateway.core.filter.threadpool.ThreadPoolForInterfaceLogFilter;
import java.util.concurrent.ExecutorService;

/**
 * @author guoshan
 * @date 2019年07月18日
 * 记录接口日志信息工具类
 */
public class RecordInterfaceLogUtils {

    /**
     * 记录已登录用户接口访问日志
     * @author guoshan
     * @date 2019-09-10
     * @param interfaceLog 日志信息实体对象
     */
    public static void recordLoggedInterfaceLog(RecordInterfaceLogThread interfaceLog) {
        ExecutorService threadExecutor = ThreadPoolForInterfaceLogFilter.getInstance();
        threadExecutor.execute(interfaceLog);
    }

    /**
     * 记录未登录用户接口访问日志
     * @author guoshan
     * @date 2019-09-10
     * @param interfaceLog 日志信息实体对象
     */
    public static void recordNoLoginInterfaceLog(RecordInterfaceLogThread interfaceLog) {
        ExecutorService threadExecutor = ThreadPoolForInterfaceLogFilter.getInstance();
        threadExecutor.execute(interfaceLog);
    }
}
